/**
 * 
 */
package com.epam.entity;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author Nugumanova V.
 *
 */
public  class Person extends User{
	protected String name;
	protected String iin;
	protected String address;
	protected String phone;
	protected Date dateOfBirth;
	
	public Person(long id,String userName, String password, Role status,
			String name, String iin, String address,
			String phone, Date dateOfBirth) {		
	super (id, userName, password, status);
		this.name = name;
		this.iin = iin;
		this.address = address;
		this.phone = phone;
		this.dateOfBirth = dateOfBirth;
	}

	public String getName() {
		return name;
	}

	public String getIin() {
		return iin;
	}

	public String getAddress() {
		return address;
	}

	public String getPhone() {
		return phone;
	}

	public Date getDateOfBirth() {
		return dateOfBirth;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setIin(String iin) {
		this.iin = iin;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public void setDateOfBirth(Date dateOfBirth) {
		this.dateOfBirth = dateOfBirth;
	}

	@Override
	public String toString() {
		StringBuilder s = new StringBuilder();
		SimpleDateFormat sdf = new SimpleDateFormat("dd.mm.yyyy");
		s.append("name ").append(name);
		s.append(" iin ").append(iin).append("\n");
		s.append("address ").append(address);
		s.append(" phone ").append(phone).append("\n");
		s.append("date of birth ").append(sdf.format(dateOfBirth));
		return s.toString();
	}

}
